﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="manage.aspx.cs" Inherits="AnyOffice.general.calendar.manage.manage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>日程安排</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script Language="JavaScript">
			window.setTimeout('this.location.reload();',60000);
		</script>
		<script>
my_top=50;
my_left=50;

function my_note(CAL_ID)
{
  my_top+=25;
  my_left+=15;

  window.open("note.aspx?cal_id="+CAL_ID,"note_win"+CAL_ID,"height=170,width=180,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,top="+ my_top +",left="+ my_left +",resizable=no");
}
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/menu/calendar.gif" align="absMiddle"><span class="big3">
							新建事务（<asp:Literal id="litToday" runat="server"></asp:Literal>）</span><br>
					</td>
				</tr>
			</table>
			<div align="center">
				<input type="button" value="新建事务" class="BigButton" onClick="location='new.aspx?date=<%=ViewState["SpecifyDate"]%>';"
					title="创建新的事务，以便提醒自己">
			</div>
			<br>
			
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/menu/calendar.gif" align="absMiddle"><span class="big3">
							管理日程安排（<asp:Literal id="litToday2" runat="server"></asp:Literal>）</span>
					</td>
				</tr>
			</table>
			<br>
			<asp:Repeater id="rptCalendar" runat="server" Visible="False">
				<HEADERTEMPLATE>
					<TABLE class="small" cellSpacing="1" cellPadding="3" width="95%" bgColor="#000000" border="0">
						<TBODY>
							<THEAD class="TableHeader">
								<TR>
									<TD noWrap align="center">开始时间</TD>
									<TD noWrap align="center">结束时间</TD>
									<TD noWrap align="center">事务类型</TD>
									<TD noWrap align="center">事务内容</TD>
									<TD noWrap align="center">安排人</TD>
									<TD noWrap align="center">状态</TD>
									<TD noWrap align="center">操作</TD>
								</TR>
							</THEAD>
				</HEADERTEMPLATE>
				<ItemTemplate>
							<tr class="TableLine1">
								<td nowrap align="center"><%# DateTime.Parse(Eval("StartTime").ToString()).ToString("t") %></td>
								<td nowrap align="center"><%# DateTime.Parse(Eval("EndTime").ToString()).ToString("t") %></td>
								<td nowrap><%# (Convert.ToInt32(Eval("CalType").ToString()) == 1)?"工作事务":"个人事务"%></td>
								<td><%#Eval("Content")!=DBNull.Value?Eval("Content").ToString().Replace("\n","<br>"):""%></td>
								<td nowrap align="center"><%# Eval("ManagerUserName")%></td>
								<td nowrap align="center">
								<%# (DateTime.Now >= DateTime.Parse(Eval("StartTime").ToString())) && (DateTime.Now <= DateTime.Parse(Eval("EndTime").ToString()))?"<font color='#00AA00'><b>进行中</span>":"" %>
								<%# (DateTime.Now >= DateTime.Parse(Eval("EndTime").ToString()))?"<font color='#FF0000'><b>过期</span>":"" %>
								<%# (DateTime.Now <= DateTime.Parse(Eval("StartTime").ToString()))?"<font color='#0000AA'><b>未至</span>":"" %>
								</td>
								<td nowrap align="center">
									<a style="CURSOR: hand;font-size:12px;color:#0000ff" onclick='javascript:my_note(<%#Eval("CalId")%>);' target="_blank">
										生成便笺</a>&nbsp;<a href="edit.aspx?cal_id=<%#Eval("CalId")%>&date=<%=ViewState["SpecifyDate"]%>">
										修改</a>&nbsp;<a href="delete.aspx?date=<%=ViewState["SpecifyDate"]%>&cal_id=<%#Eval("CalId")%>">
										删除</a>
								</td>
							</tr>
						</ItemTemplate>
						<AlternatingItemTemplate>
						<tr class="TableLine2">
								<td nowrap align="center"><%# DateTime.Parse(Eval("StartTime").ToString()).ToString("t") %></td>
								<td nowrap align="center"><%# DateTime.Parse(Eval("EndTime").ToString()).ToString("t") %></td>
								<td nowrap><%# (Convert.ToInt32(Eval("CalType").ToString()) == 1)?"工作事务":"个人事务"%></td>
								<td><%#Eval("Content")!=DBNull.Value?Eval("Content").ToString().Replace("\n","<br>"):""%></td>
								<td nowrap align="center"><%# Eval("ManagerUserName")%></td>
								<td nowrap align="center">
								<%# (DateTime.Now >= DateTime.Parse(Eval("StartTime").ToString())) && (DateTime.Now <= DateTime.Parse(Eval("EndTime").ToString()))?"<font color='#00AA00'><b>进行中</span>":"" %>
								<%# (DateTime.Now >= DateTime.Parse(Eval("EndTime").ToString()))?"<font color='#FF0000'><b>过期</span>":"" %>
								<%# (DateTime.Now <= DateTime.Parse(Eval("StartTime").ToString()))?"<font color='#0000AA'><b>未至</span>":"" %>
								</td>
								<td nowrap align="center">
									<a style="CURSOR: hand;font-size:12px;color:#0000ff" onclick='javascript:my_note(<%#Eval("CalId")%>);' target="_blank">
										生成便笺</a>&nbsp;<a href="edit.aspx?cal_id=<%#Eval("CalId")%>&date=<%=ViewState["SpecifyDate"]%>">
										修改</a>&nbsp;<a href="delete.aspx?date=<%=ViewState["SpecifyDate"]%>&cal_id=<%#Eval("CalId")%>">
										删除</a>
								</td>
							</tr>
						</AlternatingItemTemplate>
				<FOOTERTEMPLATE>
					</TABLE>
				</FOOTERTEMPLATE>
			</asp:Repeater>
			<div align="center">
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<br>
				<input type="button" value="返回" class="BigButton" onClick="location='arrange.aspx';">
			</div>
		</form>
	</body>
</HTML>
